<?php
/*
 * This file is part of the BooXtore Student project.
 *
 * (c) Francis Backeland f.backeland@gmail.com
 * (c) Laurine Chaplot chaplot.laurine@orange.fr
 * (c) Julien Dutot julien.dutot@gmail.com
 * (c) Romain Guillaume romain-guillaume@orange.fr
 * (c) Guillaume Paringaux g.paringaux@gmail.com
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code
 * 
 */
namespace BXTR\AdminBundle\Form;

use Symfony\Component\Form\Guess\Guess;
use Symfony\Component\Form\Guess\TypeGuess;
use Symfony\Component\Form\FormTypeGuesserInterface;

/**
 * Class AdminTypeGuesser
 */
class AdminTypeGuesser implements FormTypeGuesserInterface
{
    public function guessType($class, $property)
    {
        //TODO: Generalize to date fields (doctrine call)
        if ($property == "publish_date") {
            return new TypeGuess('date', array('widget' => 'text'), Guess::VERY_HIGH_CONFIDENCE);
        }   
    }

    public function guessRequired($class, $property)
    {
    }

    public function guessMaxLength($class, $property)
    {
    }

    public function guessPattern($class, $property)
    {
    }
}


